package com.hooper.hosp.repository;

import com.hooper.hosp.model.hosp.Hospital;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Tim Hooper
 * @version 1.0
 * @time 2022/09/28/10:29
 */
@Repository
public interface HospRepository extends MongoRepository<Hospital,String> {
    /**
     * find hosp obj by its hoscode
     * @param hoscode hosp code
     * @return
     */
    Hospital findHospitalByHoscode(String hoscode);

    /**
     * find a hosp by its id
     * @param id hosp id
     * @return
     */
    Hospital findHospitalById(String id);

    /**
     * find all hospitals whose name contains the hosname
     * @param hosname fuzzy name
     * @return        all the hospitals
     */
    List<Hospital> findAllByHosnameLike(String hosname);
}
